
<form method="post" action="#" id="dform" name="dform"  >
<table>

<tbody>
    <tr>
<td class="tl">当前操作</td>
<td class="tr f_red f_b">采购支付</td>
</tr>
<tr>
<td class="tl">商品信息</td>
<td class="tr">{$buy[title]}</td>
</tr>
<tr>
<td class="tl">价格要求</td>
<td class="tr">￥{$buy[price]}元</td>
</tr>
<tr>
<td class="tl">采购数量</td>
<td class="tr">{$buy[amount]}</td>
</tr>
<tr>
<td class="tl">行业</td>
<td class="tr"><a href="http://b2b.ahroot.com/api/redirect.php?itemid={$buy[itemid]}" target="_blank" class="t">{$buy[catname]}</a></td>
</tr>
<tr>
<td class="tl">商品图片</td>
<td class="tr"><a href="http://b2b.ahroot.com/api/redirect.php?itemid={$buy[itemid]}" target="_blank">{if $buy[thumb]}<img src="{$buy[thumb]}" height="60" width="60">{/if}{if $buy[thumb1]}<img src="{$buy[thumb1]}" height="60" width="60">{/if}{if $buy[thumb2]}<img src="{$buy[thumb2]}" height="60" width="60">{/if}</a></td>
</tr>
<tr>
<td class="tl">卖家</td>
<td class="tr"><a href="http://b2b.ahroot.com/member/chat.php?touser={$buy[editor]}" target="_blank" rel="nofollow"><img src="http://b2b.ahroot.com/api/online.png.php?username={$buy[editor]}&amp;style=0" title="点击交谈/留言" alt="" onerror="this.src=DTPath+'file/image/web-off.gif';" align="absmiddle"></a>&nbsp;<a href="http://b2b.ahroot.com/index.php?homepage={$buy[editor]}&amp;file=contact" target="_blank" class="t">{$buy[editor]}</a></td>
</tr>
<tr>
<td class="tl">发布时间</td>
<td class="tr">{timetodate($buy[addtime], 5)}</td>
</tr>
<tr>
<td class="tl">我的备注</td>
<td class="tr">{$buy[introduce]}</td>
</tr>
 
<tr>
<td class="tl">实付金额</td>
<td class="tr f_red">￥{$buy[price]}元</td>
</tr>
<tr>
<td class="tl">帐户余额</td>
<td class="tr f_blue">￥{$userinfo[money]}元</td>
</tr>
<td class="tl">资金锁定</td>
<td class="tr f_blue">￥{$userinfo[locking]}元</td>
</tr>
<tr><td style="height:25px"></td></tr>
<tr id="payword">
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr"><input name="password"  style="width:140px;" id="password" type="password" value="">&nbsp;
</tr>
<tr>
    
<td class="tl"> </td>
<td class="tr">

<input type="hidden" name="" id="price_" value="{$buy[price]}"/>
<input type="hidden" name="" id="total_" value="{$userinfo[total]}"/>
<input name="submit" value=" 确 定 "  class="btn_g" type="button" onclick="pay()">&nbsp;&nbsp;<input value=" 返 回 " class="btn" onclick="history.back(-1);" type="button">
</td>
</tr>

</tbody>

</table></form>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/jquery.js"></script>
 

<script>
    function pay(){
        var price = $("#price_").val();
        var total = $("#total_").val();
       // if(price-total>0){
       //     alert("余额不足，请先充值");return false; 
     //   }
      $.ajax({
                type: "GET",
                url: 'my.php?mid=6&itemid={$buy[itemid]}&flag=2&action=purchase&catid={$buy[catid]}',
                
            success: function(data){
               if(8==data){
                   alert('支付成功');
                   window.parent.cDialog();
               }else if(1==data){
                    alert('余额不足，请先充值');
                    window.parent.cDialog();
               }else if(2==data){
                    alert('订单已支付');
                    window.parent.cDialog();
               }else if(3==data){
                    alert('支付失败');
                    window.parent.cDialog();
               }
            }
        }, 'json');
  
    }
</script>